/**
 * 求ax2+bx+c=0方程的根。a,b,c分别为函数的参数，
 */

import java.util.Scanner;

public class FunctionSolution {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入方程:");
        System.out.print("x^2的系数是：");
        double a = scan.nextInt();
        System.out.print("x的系数是：");
        double b = scan.nextInt();
        System.out.print("常数项是：");
        double c = scan.nextInt();

        if (a == 0) {
            if (b != 0) {
                System.out.println("x = " + (-c / b));
            } else {
                System.out.println("x = any");
            }
        } else {
            double delta_2 = b * b - 4 * a * c;
            if (delta_2 < 0) {
                System.out.println("None");
            } else if (delta_2 == 0) {
                System.out.println("x = " + (-b / a / 2));
            } else {
                System.out.println("x = " + ((-b + Math.sqrt(delta_2)) / (2 * a)) + ", " + ((-b - Math.sqrt(delta_2)) / (2 * a)));
            }

        }
    }
}
